Week 8
Milestones
- Implemented Batch API
- Implemented Template API
Approach
Alright now to complete up the Generator API we can start working on the Batch API and Template API. The Batch API will be responsible for handling the batch processing of the templates and the Template API will be responsible for handling the templates.
This is the Batch API Spec: specs
Batch API
Here is the Batch schema
export class BatchResponse {
id: string;
createdAt: Date;
templateType: TemplateType;
templateID: number;
payload: any[];
status: string;
output: string[];
outputType: string;
}
So this is how the flow is we will be using RabbitMQ
for async processing using the Producer
to send the payload to the Worker
which will be responsible for processing the payload using Plugins
and then updating the status of the batch with the output in the database which the user can track.
Template API
Here is the Template schema
export class Template {
id: number;
content: string;
templateType: TemplateType;
}
Here is the TemplateType enum
export enum TemplateType {
JINJA = "JINJA",
EJS = "EJS",
JSTL = "JSTL",
}
Using the Template API the user can create, update, delete and get the templates. All the endpoints are properly documented using Swagger Documentation.
Screenshots / Videos
Swagger Docs
Contributions
Here is the link to the PR: PR
Next Steps
- Implement the Batch API using RabbitMQ.
- Implement the OAuth Flow using Google Cloud as the provider.
- Use Jest to write tests for the APIs.